package com.team.six.bluecatshop.controller;

import com.team.six.bluecatshop.domain.SeachCustomerResponse;
import com.team.six.bluecatshop.service.CustomerService;
import com.team.six.bluecatshop.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/adminCustomer")
public class AdminCustomerController {

    @Autowired
    CustomerService customerService;
    @Autowired
    ProductService productService;
    @Autowired
    FileController fileController;
    /**
     * 跳转至Customer展示页面
     */
    @RequestMapping("/customerList")
    public String productGetList(Model model){

        return "administration/customer_list";
    }
    /**
     * 处理Customer展示请求
     */
    @GetMapping("/api/customerList")
    @ResponseBody
    public SeachCustomerResponse seachCustomerResponse(Integer pageNum, Integer pageSize, String keyword){
        return customerService.findCustomerAll(pageNum,pageSize,keyword);
    }

}
